package pl.veneo.wigprofit.model.items {
	/**
	 * @author Tomasz Swierszcz, fiodorkrk@gmail.com
	 */
	public class AbstractDataItem extends Object {
		
		protected var _date : Date;
		
		public function AbstractDataItem(dateString : String = null) {
			
			if (dateString) {
				var dateArray : Array = dateString.split('.');
				setDate(dateArray[0], dateArray[1], dateArray[2]);
			}
		}
		
		public function get date() : Date {
			return _date;
		}
		
		public function get timestamp() : Number {
			return _date.valueOf();
		}

		public function setDate(year : int, month : int, day : int) : void {
			_date = new Date(year, month - 1, day);
		}
		
		public function toString() : String {
			return '[' + date + '] ';
		}
		
	}
}
